# coding=utf8

# Copyright 2018 JDCLOUD.COM
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# NOTE: This class is auto generated by the jdcloud code generator program.

from jdcloud_sdk.core.jdcloudrequest import JDCloudRequest


class UpdateWafWhiteRuleRequest(JDCloudRequest):
    """
    修改指定的白名单规则
    """

    def __init__(self, parameters, header=None, version="v1"):
        super(UpdateWafWhiteRuleRequest, self).__init__(
            '/domain/{domain}/wafWhiteRule/{id}', 'POST', header, version)
        self.parameters = parameters


class UpdateWafWhiteRuleParameters(object):

    def __init__(self, domain, id, ):
        """
        :param domain: 用户域名
        :param id: 需要修改的白名单ID
        """

        self.domain = domain
        self.id = id
        self.ruleType = None
        self.matchOp = None
        self.val = None
        self.actions = None

    def setRuleType(self, ruleType):
        """
        :param ruleType: (Optional) 白名单类型， uri ip geo
        """
        self.ruleType = ruleType

    def setMatchOp(self, matchOp):
        """
        :param matchOp: (Optional) 匹配模式,uri类型有效，0=完全匹配  1=前缀匹配 2=包含 3=正则 4=大于 5=后缀
        """
        self.matchOp = matchOp

    def setVal(self, val):
        """
        :param val: (Optional) 匹配值
        """
        self.val = val

    def setActions(self, actions):
        """
        :param actions: (Optional) 后续处理 "waf" "cc" "deny"自由组合，空表示跳过后续所有阶段
        """
        self.actions = actions

